import request from '@/utils/request'

// 获取所有科室名称
export function getDepartmentNames() {
  return request({
    url: '/system/departments/departmentNames',
    method: 'get'
  })
}

// 查询科室信息列表
export function listDepartments(query) {
  return request({
    url: '/system/departments/list',
    method: 'get',
    params: query
  })
}

// 查询科室信息详细
export function getDepartments(id) {
  return request({
    url: '/system/departments/' + id,
    method: 'get'
  })
}

// 新增科室信息
export function addDepartments(data) {
  return request({
    url: '/system/departments',
    method: 'post',
    data: data
  })
}

// 修改科室信息
export function updateDepartments(data) {
  return request({
    url: '/system/departments',
    method: 'put',
    data: data
  })
}

// 删除科室信息
export function delDepartments(id) {
  return request({
    url: '/system/departments/' + id,
    method: 'delete'
  })
}

// 获取院区表的院区名称
export function getHospitalCampusName(){
  return request({
    url: '/system/departments/listName',
    method: 'GET'
  })
}

//根据院区id删除科室信息
export function delDepartmentsByCampusId(id) {
  return request({
    url: '/system/departments/deleteByCampusId/' + id,
    method: 'delete'
  })
}
//根据院区名称查找科室
export function getDepartmentsByhospitalArea(hospitalArea) {
  return request({
    url: '/system/departments/getDepartmentsByhospitalArea/' + hospitalArea,
    method: 'get'
  })
}


